ERROR_READ_ONLY
ERROR_READ_ONLY = 1
Model class for the local address book database
$primary_key : string
$groups : bool
$export_groups : bool
$readonly : bool
$searchonly : bool
$undelete : bool
$ready : bool
$group_id : null|string|int
$list_page : int
$page_size : int
$sort_col : string
$sort_order : string
$date_cols : string[]
$coltypes : array
$vcard_map : string[]
$error : ?array
$db : \rcube_db
Store database connection.
list_records(mixed $cols = null, mixed $subset, mixed $nocount = false) : array
List the current set of contact records
mixed | $cols | List of columns to include in the returned records (null means all) |
mixed | $subset | Only return this number of records of the current page, use negative values for tail |
mixed | $nocount | True to skip the count query (select only) |
Indexed list of contact records, each a hash array
search(mixed $fields, mixed $value, int $mode, bool $select = true, bool $nocount = false, array $required = []) : \rcube_result_set
Search contacts
mixed | $fields | The field name or array of field names to search in |
mixed | $value | Search value (or array of values when $fields is array) |
int | $mode | Search mode. Sum of rcube_addressbook::SEARCH_* |
bool | $select | True if results are requested, False if count only |
bool | $nocount | True to skip the count query (select only) |
array | $required | List of fields that cannot be empty |
Contact records and 'count' value
validate(array $save_data, bool $autofix = false) : bool
Check the given data before saving.
If input not valid, the message to display can be fetched using get_error()
array | $save_data | Associative array with data to save |
bool | $autofix | Try to fix/complete record automatically |
True if input is valid, False if not.
rename_group(string $gid, string $name, string $new_gid) : string|false
Rename a specific contact group
string | $gid | Group identifier |
string | $name | New name to set for this group |
string | $new_gid | (not used) |
New name on success, false if no data was changed
get_col_values(string $col, array $data, bool $flat = false) : array
Utility function to return all values of a certain data column either as flat list or grouped by subtype
string | $col | Col name |
array | $data | Record data array as used for saving |
bool | $flat | True to return one array with all values, False for hash array with values grouped by type |
List of column values
compose_display_name(array $contact, bool $full_email = false) : string
Compose a valid display name from the given structured contact data
array | $contact | Hash array with contact data as key-value pairs |
bool | $full_email | Don't attempt to extract components from the email address |
Display name
compose_list_name(array $contact) : string
Compose the name to display in the contacts list for the given contact record.
This respects the settings parameter how to list contacts.
array | $contact | Hash array with contact data as key-value pairs |
List name
compose_search_name(array $contact, string $email = null, string $name = null, string $templ = null) : string
Build contact display name for autocomplete listing
array | $contact | Hash array with contact data as key-value pairs |
string | Optional email address |
|
string | $name | Optional name (self::compose_list_name() result) |
string | $templ | Optional template to use (defaults to the 'contact_search_name' config option) |
Display name
compare_search_value(string $colname, string|array $value, string $search, int $mode) : bool
Compare search value with contact data
string | $colname | Data name |
string|array | $value | Data value |
string | $search | Search value |
int | $mode | Search mode |
Comparison result